DataSource for Entity Framework for WinForms
AsLive<T>(ICollection<T>,EntityClientScope) メソッド

C1.Data.Entity.4.5.2 アセンブリ > C1.Data.Entities 名前空間 > EntityFrameworkExtensions クラス > AsLive メソッド : AsLive<T>(ICollection<T>,EntityClientScope) メソッド
pocoCollection内のエンティティの型。
変換するエンティティコレクション。 System.Data.Entity.Core.Objects.DataClasses.EntityCollection`1型である必要があります。
このコレクションを所有するエンティティが属する EntityClientScope(この範囲内で エンティティがクエリーによって取得、または作成されます)。
POCO System.Data.Entity.Core.Objects.DataClasses.EntityCollection`1を編集可能な ライブビューに変換します。
シンタックス
'宣言
 
Public Overloads Shared Function AsLive(Of T As Class)( _
   ByVal pocoCollection As System.Collections.Generic.ICollection(Of T), _
   ByVal scope As EntityClientScope _
) As View(Of T)
public static View<T> AsLive<T>( 
   System.Collections.Generic.ICollection<T> pocoCollection,
   EntityClientScope scope
)
where T: class

パラメータ

pocoCollection
変換するエンティティコレクション。 System.Data.Entity.Core.Objects.DataClasses.EntityCollection`1型である必要があります。
scope
このコレクションを所有するエンティティが属する EntityClientScope(この範囲内で エンティティがクエリーによって取得、または作成されます)。

型パラメータ

T
pocoCollection内のエンティティの型。

戻り値の型

結果の ライブビュー
例外
例外解説
pocoCollectionSystem.Data.Entity.Core.Objects.DataClasses.EntityCollection`1型ではありません。
解説
POCO オブジェクトが使用されている場合(プロキシ使用)、ナビゲーションコレクションのプロパティの型は、 System.Data.Entity.Core.Objects.DataClasses.EntityCollection`1ではなく、 System.Collections.Generic.ICollection`1になります(ただし、実行時には System.Data.Entity.Core.Objects.DataClasses.EntityCollection`1になります)。 特別な AsLive 拡張メソッドを使用する必要があるのは、このためです。
参照

EntityFrameworkExtensions クラス
EntityFrameworkExtensions メンバ
オーバーロード一覧